﻿using System.ComponentModel;
using System.Windows.Forms.Design;

namespace HML.Design
{
    /// <summary>
    ///NumeralAdjustLabel控件设计模式行为
    /// </summary>
    internal class NumeralAdjustLabelDesigner : ControlDesigner
    {
        public override SelectionRules SelectionRules
        {
            get
            {
                SelectionRules selectionRules = base.SelectionRules;
                object component = (object)this.Component;
                PropertyDescriptor propertyDescriptor = TypeDescriptor.GetProperties(component)["AutoSize"];
                if (propertyDescriptor != null && (bool)propertyDescriptor.GetValue(component))
                {
                    selectionRules &= ~SelectionRules.AllSizeable;
                }
                return selectionRules;
            }
        }

        public NumeralAdjustLabelDesigner()
        {
            this.AutoResizeHandles = true;
        }

    }
}
